package com.sky.business.sys.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sky.common.enums.Arch;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 节点
 */
@Data
@TableName(value = "d_node", autoResultMap = true)
public class Node implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "id")
    private Integer id;

    /**
     * 描述
     */
    @TableField(value = "description")
    @Schema(description = "描述")
    private String description;

    /**
     * 架构
     */
    @TableField(value = "arch")
    @Schema(description = "架构")
    private Arch arch;

    /**
     * IP4地址
     */
    @TableField(value = "ip_addr")
    @Schema(description = "IP4地址")
    private String ipAddr;

    /**
     * 容器服务端口
     */
    @TableField(value = "container_port")
    @Schema(description = "容器服务端口")
    private Integer containerPort;

    /**
     * 是否就绪
     */
    @TableField(value = "ready")
    @Schema(description = "是否就绪")
    private Boolean ready;


    /**
     * 总内存,单位MB
     */
    @TableField(value = "total_memory")
    @Schema(description = "总内存,单位MB")
    private Integer totalMemory;


    /**
     * 空闲内存,单位MB
     */
    @TableField(value = "free_memory")
    @Schema(description = "空闲内存,单位MB")
    private Integer freeMemory;


    /**
     * 使用内存,单位MB
     */
    @TableField(value = "used_memory")
    @Schema(description = "使用内存,单位MB")
    private Integer usedMemory;


    /**
     * cpu逻辑内核数
     */
    @TableField(value = "cpu_logical_core")
    @Schema(description = "cpu逻辑内核数")
    private Integer cpuLogicalCore;


    /**
     * cpu物理内核数
     */
    @TableField(value = "cpu_physical_core")
    @Schema(description = "cpu物理内核数")
    private Integer cpuPhysicalCore;

    /**
     * cpu空闲比例
     */
    @TableField(value = "cpu_idle_percent")
    @Schema(description = "cpu空闲比例")
    private Integer cpuIdlePercent;


    /**
     * 硬盘空闲空间,单位MB
     */
    @TableField(value = "disk_free")
    @Schema(description = "硬盘空闲空间,单位MB")
    private Integer diskFree;


    /**
     * 显卡数量
     */
    @TableField(value = "gpu_count")
    @Schema(description = "显卡数量")
    private Integer gpuCount;

    /**
     * gpu空闲显卡
     */
    @TableField(value = "gpu_idle_memory")
    @Schema(description = "gpu空闲显卡")
    private Integer gpuIdleMemory;

    /**
     * 分组id
     */
    @TableField(value = "group_id")
    @Schema(description = "分组id")
    private Integer groupId;

    /**
     * 最后一次心跳时间
     */
    @TableField(value = "last_heart_beat_time")
    @Schema(description = "最后一次心跳时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastHeartBeatTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "更新时间")
    private Date updateTime;

    /**
     * 是否删除
     */
    @TableField(value = "is_del")
    @Schema(description = "是否删除")
    private Boolean isDel = false;
}